package com.zwh.se.number.concurrent;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * @author yexi
 */
public class AtomicIntegerDemo {
    public static void main(String[] args) {
        AtomicInteger atomicInteger = new AtomicInteger(5);
        //获取原子Integer当前的值并返回,然后底层存储的值+1
        System.out.println(atomicInteger.getAndIncrement());
        System.out.println(atomicInteger);

    }
}
